<!DOCTYPE html>
<html class="login-bg">
<head>
	<title>E8NET - Find password</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <include file="./App/Admin/View/Include/css.html" />
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/compiled/signup.css" type="text/css" media="screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="header">
        <p style="font-size:1.5em; color:#fff;"></p>
    </div>
    <div class="row-fluid login-wrapper">
        <div class="box">
            <div class="content-wrap">

                <h6>输入您的登录账号和关联邮箱</h6>
                <input class="span12" id="act" name="account" type="text" placeholder="账号" />
                <input class="span12" id="email" name="email" type="text" placeholder="关联邮箱" />
                <input id="rol" type="hidden" name="role" value="super" />

                <div class="btn-group toggle-inputs hidden-tablet">
                    <button class="glow left active" data-input="super">总管理员</button>
                    <button class="glow center" data-input="department">院管理员</button>
                    <button class="glow right" data-input="teacher">教师</button>
                </div><br />

                <span id="msg" style="display: none; color:darkred;">
                    <i class="icon-remove-sign"></i>
                    <small></small>
                </span>

                <div class="action">
                    <a class="btn-flat info" href="javascript:sendemail();">下一步</a>
                </div>                
            </div>
        </div>

    </div>

    <include file="./App/Admin/View/Include/modal.html" />

	<!-- scripts -->
    <script src="__PUBLIC__/Admin/js/jquery-latest.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/Admin/js/theme.js"></script>
    <script src="__PUBLIC__/Admin/js/tools.js"></script>

    <script type="text/javascript">
        $(function () {
            var $buttons = $(".toggle-inputs button");
            $buttons.click(function () {
                var val = $(this).data("input");
                $('#rol').val(val);
                $buttons.removeClass("active");
                $(this).addClass("active");
            });
        });
    </script>

    <script>

        function sendemail() {

            var account = $('#act').val();
            var email = $('#email').val();
            var role = $('#rol').val();

            if (account == "" || email == "") {
                $('#msg > small').html('账号/关联邮箱不能为空');
                $('#msg').show();
                return;
            }

            lshow();
            $.post("{:U('Findpwd/send')}",{role:role,account:account,email:email},
                function(result){
                var obj = eval('(' + result + ')');
                if (obj.result == "RESULT_OK") {
                    window.location.href = obj.data;
                } else {
                    lhide();
                    $('#msg > small').html(obj.msg);
                    $('#msg').show();
                }
            });
        }

    </script>

</body>
</html>